﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ProgettoWlanService
{
    public class LogFile {

        private FileStream fs;
        private StreamWriter sw;

        private const string path = @"C:\Users\Alessandro Avila\Polito\Primo anno\Programmazione di sistema\C++\";

        public LogFile(string fileName) {
            fs = new FileStream(path + fileName, FileMode.Create);
            sw = new StreamWriter(fs);
        }

        public void write(string text) {
            sw.WriteLine(text);
            sw.Flush();
        }

        public void delete(string fileName) {
            File.Delete(path + fileName);
        }

        public void close() {
            sw.Close();
            fs.Close();
        }
    }
}